package scalar

import (
	"errors"
	"github.com/99designs/gqlgen/graphql"
	"gorm.io/datatypes"
	"io"
)

func MarshalJsonb(t datatypes.JSON) graphql.Marshaler {

	return graphql.WriterFunc(func(w io.Writer) {
		w.Write(t)
	})
}

func UnmarshalJsonb(v interface{}) (datatypes.JSON, error) {

	return datatypes.JSON{}, errors.New("test error")
}
